package com.petAdoption.manager.controller;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.petAdoption.manager.service.IProductlistService;
import com.petAdoption.manager.util.Result;
import com.petAdoption.manager.vo.ExaminedeliverVO;
import com.petAdoption.manager.vo.ProductlistVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王倩茹
 * @since 2023-08-28
 */
@RestController
@RequestMapping("/productlist")
public class ProductlistController {
    @Resource
    private IProductlistService productlistService;
    @Resource
    private Result result;
    @GetMapping("/findAll/{pageNum}")
    public Result findAll(@PathVariable Integer pageNum){
        PageHelper.startPage(pageNum,10);
        List<ProductlistVO> list = productlistService.findAll();
        return result.success(new PageInfo<>(list));
    }
}
